#coding=UTF-8
def SearchForm(query=""):
  if isinstance(query, unicode):
    query = query.encode("utf-8")
  return """<form name="search" action="../querytagindex" method="get">
  <input type="text" name="words" value=\""""+query+"""\" style="width:45%" />
  <input type="submit" value="搜索" /></form>"""

def PageHead(query=""):
  return """<table style="width:100%" border="0">
  <tr><td valign=top style="font-weight:bold;font-size:32px;width:150px">
  <a href="./" style="color:#336699;text-decoration:none">"""+AppName()+ \
  "</a></td><td valign=top>"+SearchForm(query)+"</td></tr></table>"

def GoogleAnalytics():
  return """<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-2324340-7");
  pageTracker._trackPageview();
  } catch(err) {}</script>"""
  
def PrevPage():
  return u"上一页"

def NextPage():
  return u"下一页"

def AllTags():
  return u"所有关键字："

def ResultSummary(qc, query):
  sum = u"约有 <b>"+str(qc)+u"</b> 项和 <b>"+query+u"</b> 相符的关键字组："
  return sum.encode("utf-8")

def AppName():
  return u"Dada数据".encode("utf-8")